package com.atguigu.gmall.controller;

import com.atguigu.gmall.bean.TrafficUvCt;
import com.atguigu.gmall.service.TrafficStatsService;
import com.atguigu.gmall.util.DateFormatUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
public class TrafficStatsController {
    @Autowired
    private TrafficStatsService trafficStatsService;
    @RequestMapping("/ch")
    public String getChUvCt(@RequestParam(value = "date", defaultValue = "0") Integer date,
                            @RequestParam(value = "limit", defaultValue = "10") Integer limit){
        if (date == 0){
            date = DateFormatUtil.now();
        }
        List<TrafficUvCt> trafficUvCtList = trafficStatsService.getChUcCt(date, limit);
        List uvList= new ArrayList();
        List chList= new ArrayList();


    }
}
